‫Welcome to lecture 11.
‫Now, before we proceed, I would like to show you how to edit this item with the parameters.
‫I know that I said that this lecture is going to be covering on Adelaide and we are going to do that.
‫But before we go, we go there.
‫Let me just show you how to pass parameters here so that we don't have to code these things.
‫We pass them from our API.
‫And so here we are going to expect two things.
‫And the first thing I'm going to be expecting is their name.
‫That is going to be the name where we're editing.
‫And the second thing we're going to be expecting here is their maybe their new.
‫I think, OK, now we can call it a new item, name something like that new item name, and this is
‫what is going to go here.
‫You remember he's going to be formatted string, so he's going to have that and then the name is what
‫is going to go inside of him.
‫So delete that and put your name here.
‫So we are going to be seeing an update tab that said that the name is the new item name and a new item
‫name and where the name is the name.
‫OK.
‫And then are going to commit it and that will be successful.
‫So what we have done here is we have said update from this table set the item name is the new item name
‫in the bill.
‫The name is this name.
‫And now we can go to our postman with these two items.
‫We have this and we have name and now we can go to our update function and what we need to do here in
‫the body.
‫We need to pass these two parameters.
‫We will have a name here and we will have this one.
‫Now, let us now try and update road here.
‫Let us go ahead and update that item so that the name is that this is very important because it's a
‫primary key.
‫So this is all going to go here.
‫This is easy.
‫And this is going to be updated that Ippei, I think.
‫OK.
‫And then when you send this, maybe I can just change this message a little instead of seeing just it
‫says it will stay updated.
‫Item updated, something like that item has been updated, something close to that.
‫So send it.
‫You know, this is item has been updated successfully.
‫Wonderful.
‫Reloaded, this item reloaded.
‫And yes, now this one has been updated by using the parameters that we have passed here.
‫OK, so this are you going to do it from your front end application?
‫No.
‫Let's go and cover the purpose for this letter.
‫This one was supposed to be covering the delete function in ERP next API and therefore we are going
‫to come back to our API file in this state by Frappier Titlist.
‫It is our function, so I don't forget.
‫And then we define our function here, which we're going to call delete item.
‫And then again, as usual, you're going to hardcoded and then you're going to pass on the key from
‫our API front end application.
‫And then here we're going to see Rapido to be brought as well.
‫So that's to allow us to write our estimate here.
‫One, two, three, one, two, three.
‫Remember that.
‫And then we're going to say not update but delete.
‫This is normally squill.
‫So we are going to say delete from our table is tab item saudade from the item and we want to delete
‫where again, if you don't supply the are close this is going to disappear.
‫So name equals.
‫And again, here we are going to parse what we want to delete lasciviously from auditability.
‫Lodhia, let us delete the fourth item here.
‫So ATSDR, we can copy this and we bring it to our code and pasted it APIs.
‫Oh I copied.
‫Oh sorry.
‫Let me copy this and then I will of that.
‫OK, OK, it is copied, I think so we pasted and so delete from that we name because remember this
‫name, I'm not putting it in his head of their politics because it is only one item limit or something
‫like item, name, description, you have to put it instead of marketing.
‫So even in this one, if you put batiks, there's not going to be any problem.
‫So if you go back to the item so that we see our item go away and then here, remember, we need to
‫do four appear to be able to commit.
‫And then we can just written a message saying, I deleted something like that, OK?
‫You can customize this message to whatever you want to add to the user experience of your application
‫is going to be superb.
‫OK, so let's go and transcend this.
‫Remember, we have done a few a few things here.
‫We have our way to restore its function.
‫And the other thing that we need to do, I had this that this already is to add authorization and you
‫pass in.
‫You are talking.
‫OK, so let me send this and we get a deleted deleted.
‫And when we come here, reload with the item is not there.
‫It has been deleted from our database reload.
‫And yes, the item is gone.
‫It is not in the database.
‫So how about when we need to pass a parameter.
‫We we are not going to be deleting one item.
‫So this item is not one of them.
‫So if we try and send this again, we are going to be this item.
‫Yes, but certainly is because we we are returning this message at the end of this function.
‫So this this thing, there is anything because there is no this item doesn't exist.
‫So what we need to do is to pass here in our in our method.
‫We need to pass here the the the name of the item that we need to delete.
‫Then this name, of course, we are going to make this are formatted string and now we are going to
‫have his name there.
‫So it's going to be dynamic, is going to be dynamically deleting items into a database.
‫Then we go to our API.
‫Remember, this is going to come from your front end application in the body.
‫We want to have a form letter of the name and the name.
‫Now, let us try something else.
‫We reload, we have work and we can delete updated Adlard Hibiya.
‫So this is easy is going to be the next goal here for us here and send it in.
‫This is item deleted.
‫Confirm and boom.
‫The item is not there, it is deleted.
‫So if you pass y y y on this function here, why, why, why, why this going again to go ahead and
‫delay that item, come back, reload.
‫The item is gone.
‫So this is it.
‫That is how you do a function to delete items into our database.
‫So up to this point we have been able to get how we have done and we have done a bit and we have done
‫delete.
‫So let me see you in the next.
‫Let's jump in to show you something fancy.
‫See you then.